package com.BMS.entity;

import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.Id;
import javax.persistence.Table;

import com.alibaba.fastjson.JSONObject;

/**
 * 读者实体类
 * @author lenovo
 *
 */
@Entity
@Table(name = "reader")
public class Reader {
	
	private String reader_ID;  // 读者ID
	
	private String name;  // 姓名
	
	private String password;  // 登录密码
	
	private String sex;  // 性别
	
	private int age;  // 年龄
	
	public Reader(){
		
	}

	@Id
	@Column(name = "reader_ID", nullable = false, unique = true, length = 12)
	public String getReader_ID() {
		return reader_ID;
	}

	public void setReader_ID(String reader_ID) {
		this.reader_ID = reader_ID;
	}

	@Column(name = "name", nullable = false, length = 5)
	public String getName() {
		return name;
	}

	public void setName(String name) {
		this.name = name;
	}

	@Column(name = "password", nullable = false, length = 32)
	public String getPassword() {
		return password;
	}

	public void setPassword(String password) {
		this.password = password;
	}

	@Column(name = "sex", nullable = true, length = 1)
	public String getSex() {
		return sex;
	}

	public void setSex(String sex) {
		this.sex = sex;
	}

	@Column(name = "age", nullable = true, length = 3)
	public int getAge() {
		return age;
	}

	public void setAge(int age) {
		this.age = age;
	}
	
	@Override
	public String toString() {
		JSONObject obj = new JSONObject();
		return obj.toJSONString(this);
	}
}
